#include "../Lib/gamegatebus.h"
#include "Handler.h"
#include "gatecommon.h"

int main(int argc, char *argv[])
{
	ACE_Select_Reactor select_reactor;
	ACE_Reactor reactor(&select_reactor);
	ACE_Reactor::instance(&reactor, 0);

	if(!CGameGateBus::instance().OpenBus())
		return false;

	AcceptorHandler *pAcceptor = new AcceptorHandler;
	ACE_INET_Addr addr;
	addr.set(5005);
	if(pAcceptor->open(addr) != 0)
		return 1;

	ThirtyMSHandler *thirtyMsHandler = new ThirtyMSHandler;
	ACE_Reactor::instance()->schedule_timer(thirtyMsHandler,NULL, ACE_Time_Value(0, 10000), ACE_Time_Value(0, 10000));

	ACE_Reactor::instance()->run_event_loop();

	return 0;
};